package com.atguigu.pratice;

import java.util.Scanner;

public class TheLuckyBag {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = scanner.nextInt();
        }
    }
    public static int findAll(int nums[],int index,long sum,long multi,int n){
        int count=0;
        for(int i=index;i<n;i++){
            sum+=nums[i];
            multi*=nums[i];
            if(sum>multi){
                count+=1+findAll(nums,i+1,sum,multi,n);
            }else if(nums[i]==1){
                count+=findAll(nums,i+1,sum,multi,n);
            }else{
                break;
            }
            sum-=nums[i];
            multi/=nums[i];
            while(i<n-1&&nums[i]==nums[i+1]){
                i++;
            }
        }
        return count;
    }
}
